// Input 基础样式
.input {
  display: inline-block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: $body-color;
  background-color: $white;
  background-clip: padding-box;
  border: 1px solid $gray-400;
  border-radius: $border-radius;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  &:focus {
    border-color: $primary;
    outline: none;
    box-shadow: 0 0 0 2px rgba($primary, 0.1);
  }
  &.disabled,
  &[disabled] {
    background-color: $gray-100;
    opacity: 0.7;
    cursor: not-allowed;
  }
}

// TextArea
.input-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: $body-color;
  background-color: $white;
  border: 1px solid $gray-400;
  border-radius: $border-radius;
  resize: vertical;
  box-sizing: border-box;
  &:focus {
    border-color: $primary;
    outline: none;
    box-shadow: 0 0 0 2px rgba($primary, 0.1);
  }
  &.disabled,
  &[disabled] {
    background-color: $gray-100;
    opacity: 0.7;
    cursor: not-allowed;
  }
}

// Search
.input-search {
  display: flex;
  align-items: center;
  .input-search-btn {
    margin-left: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border: 1px solid $primary;
    background: $primary;
    color: $white;
    border-radius: $border-radius;
    cursor: pointer;
    transition: background 0.2s;
    &:hover:not(:disabled) {
      background: darken($primary, 10%);
    }
    &:disabled {
      background: $gray-400;
      cursor: not-allowed;
    }
    .rainsleep-icon {
      margin: 0;
    }
  }
}

// Password
.input-password {
  position: relative;
  width: 320px;
  display: flex;
  align-items: center;
}

input[type="password"]::-ms-reveal {
  display: none;
}

input[type="password"]::-ms-clear {
  display: none;
}

.input-password .input {
  width: 100%;
  padding-right: 36px;
}

.input-password-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: $primary;
  z-index: 2;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
}

// DropdownInput 样式
.input-dropdown-wrapper {
  position: relative;
  display: inline-block;
  width: 320px;
}

.input-dropdown {
  width: 320px;
  border-radius: 20px;
  border: 1px solid $gray-400;
  padding: 0.5em 2.5em 0.5em 1em;
  font-size: 1rem;
  transition: border-color 0.2s;
  &:focus {
    border-color: $primary;
    outline: none;
    box-shadow: 0 0 0 2px rgba($primary, 0.1);
  }
}

.input-dropdown-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  font-size: 1.2em;
  color: $gray-600;
  background: $white;
  border-radius: 50%;
  padding: 2px 4px;
  transition: background 0.2s;
  &:hover {
    background: $gray-100;
    color: $primary;
  }
}

.input-dropdown-panel {
  display: none;
  position: absolute;
  width: 320px;
  left: 0;
  top: 110%;
  min-width: 100%;
  background: $white;
  border: 1px solid $gray-200;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  padding: 18px 20px;
  z-index: 10;
  word-break: break-all;
  font-size: 1rem;
  color: $body-color;
  margin-top: 4px;
}

.input-dropdown-panel.panel-opened {
    display: block;
  }

// 主题色（只作用于边框，不影响背景和字体色）
.input-default {
  border-color: $gray-400 !important;
  background: $white !important;
  color: $body-color !important;
}
.input-primary {
  border-color: $primary !important;
  background: $white !important;
  color: $body-color !important;
}
.input-danger {
  border-color: $danger !important;
  background: $white !important;
  color: $body-color !important;
}

// 限制输入框最大宽度
.input {
  width: 100%;
  max-width: 320px;
  min-width: 120px;
  box-sizing: border-box;
}

// 尺寸
.input-lg {
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
}
.input-sm {
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
} 